{include file='../__header.tpl'}
{if $ed}
    <input type="hidden" value="{$pd.product_id}" id="pid" /> 
{/if}
<input type="hidden" value="{$mod}" id="mod" /> 
<input type="hidden" value="{$smarty.server.HTTP_REFERER}" id="http_referer" /> 
<i id="scriptTag">page_iframe_alter_product</i>
<div style="padding-bottom: 55px;">
    <div style="padding-right: 22px;padding-top: 20px;" class="clearfix">
        <form id="uploadForm-pd" action="?/vProduct/ImageUpload" method="post" enctype="multipart/form-data" style="float:left;width:70%;">
            <input id="pd-catimg" type="hidden" value="{$pd.catimg}" />
            <input id="pd-serial-val" type="hidden" value="{$pd.product_serial}" />
            <input id="fileImage-pd" type="file" name="fileselect" size="1" />
            <input type="hidden" value="{$cat}" id="pd-form-cat" />
            {foreach from=$pd.images item=pdi}
                <input class="pd-images" type="hidden" value="{$pdi.image_path}" />
            {/foreach}
            <div style="margin-left: 22px;">
                <div class="clearfix">

                    <!-- 商品名称 -->
                    <div style="float:left;width: 66%">
                        <div class="gs-label">商品名称</div>
                        <div class="gs-text">
                            <input type="text" name="" value="{if $ed}{$pd.product_name}{/if}" id="pd-form-title" autofocus/>
                        </div>
                    </div>                    
                    <div style="float:left;width: 32%;margin-left: 2%;">

                        <!-- 商品分类 -->
                        <div class="gs-label">商品分类</div>
                        {strip}
                            <select id="pd-catselect" style="color:#000">
                                {foreach from=$categorys item=cat1}
                                    <option value="{$cat1.dataId}" {if $cat1.hasChildren}disabled{/if}>{$cat1.name}</option>
                                    {foreach from=$cat1.children item=cat2}
                                        <option value="{$cat2.dataId}" {if $cat2.hasChildren}disabled{/if}>-- {$cat2.name}</option>
                                        {foreach from=$cat2.children item=cat3}
                                            <option value="{$cat3.dataId}" {if $cat3.hasChildren}disabled{/if}>---- {$cat3.name}</option>
                                        {/foreach}
                                    {/foreach}
                                {/foreach}
                            </select>
                        {/strip}
                    </div>
                </div>
                <div class="clearfix">

                    <!-- 商品价格 -->
                    <div style="float:left;width: 32%">
                        <div class="gs-label">商品价格</div>
                        <div class="gs-text">
                            <input type="text" name="" onclick="this.select();" value="{if $ed}{$pd.sale_prices}{else}0.00{/if}" id="pd-form-prices" />
                        </div>
                    </div>

                    <!-- 商品折扣 -->
                    <div style="float:left;width: 32%;margin-left: 2%;">
                        <div class="gs-label">商品折扣</div>
                        <div class="gs-text">
                            <input type="text" name="" id="pd-form-discount" value="{if $ed}{$pd.discount}{else}100{/if}"/>
                        </div>
                    </div>

                    <!-- 商品系列 -->
                    <div style="float:left;width: 32%;margin-left: 2%;">
                        <div class="gs-label">商品系列</div>
                        <select id="pd-serial">
                            {foreach from=$serials item=ser}
                                <option value="{$ser.id}" {if $pd.product_serial eq $ser.id || $smarty.cookies.lastSerial eq $ser.id}selected{/if}>{$ser.serial_name}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>

                <!-- 商品简介 -->
                <div class="gs-label">商品简介</div>
                <span class="frm_textarea_box"><textarea class="js_desc frm_textarea" id="pd-form-desc">{if $ed}{$pd.product_subtitle}{/if}</textarea></span>

                <!-- 商品规格 -->
                <div class="gs-label">商品规格</div>

            </div>
        </form>
        <div style="margin-left:70%;padding-left:30px;">
            <a class="pd-image-sec" data-id="0" href="javascript:;"></a>
        </div>
    </div>
    <div style="padding: 0px 22px;" class="clearfix">
        <div class="gs-label">商品图集</div>
        <div id="pd-ilist" class="clearfix">
            <a class="pd-image-sec ps20" data-id="1" href="javascript:;"></a>
            <a class="pd-image-sec ps20" data-id="2" href="javascript:;"></a>
            <a class="pd-image-sec ps20" data-id="3" href="javascript:;"></a>
            <a class="pd-image-sec ps20" data-id="4" href="javascript:;"></a>
            <a class="pd-image-sec ps20" data-id="5" href="javascript:;"></a>
        </div>
        <div class="gs-label">详细介绍</div>
        <script id="ueditorp" name="content" type="text/plain">{if $ed}{$pd.product_desc}{/if}</script>
    </div>
</div>
<div class="fix_bottom fixed">
    <a id="save_product_btn" onclick="javascript:;" class="wd-btn primary">保存</a>
    <a class="wd-btn delete" id="pd-delete-btn">删除商品</a> 
    <a onclick="location.href = $('#http_referer').val();" class="wd-btn primary">返回</a>
</div>
{include file='../__footer.tpl'} 